<template>
  <div class="w-full">
    <el-form :model="form" label-width="120px" :label-position="'top'">
      <el-form-item label="标题">
        <el-input v-model="form.title" />
      </el-form-item>
      <el-form-item label="视频">
        <UploadFile v-model="form.src" @change="fileChange" title="选择视频" :fileType="['mp4']" :limit="1" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup lang='ts'>
import UploadFile from '@/components/ma-upload-file/index.vue'
const model = defineModel({
  default: {
    title: '',
    src: ''
  }
}) as any;
const form = ref(model.value);

console.log(model.value)
watch(() => form.value, (data) => {
  model.value = data;

}, {
  immediate: true,
  deep: true
})

const fileChange = (files)=>{
  console.log(files)
}
</script>

<style></style>
